<?php
// www.XXX.com/ret.php?esp=d2
// 返回：{"info":{"name":"esp01s-esp039"},"ios":{"io0":"0","io2":"1"}}
// 但这里只做个开关，只返回ios.io0的值就可以了，即0 或 1

$esp = $_GET['esp'];
$ret_dir = "./esps" . '/' . $esp;
$ret = file_get_contents($ret_dir . '/ret.txt');
$handle = fopen($ret_dir . '/calltime.txt', "w+");
$write = fwrite($handle, date('Y-m-d H:i:s'));
echo $ret;
